<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <button id="btn1">点击开始</button>

    <button id="btn2">清除计时器</button>

    <script>
        var timer1, timer2, timer3;
        btn1.onclick = function() {
            //3000毫秒之后，运行指定的函数
            timer1 = setTimeout(function() {
                console.log("计时完成1");
            }, 3000);

            timer2 = setTimeout(function() {
                console.log("计时完成2");
            }, 3000);

            timer3 = setTimeout(function() {
                console.log("计时完成3");
            }, 3000);

            console.log(timer1, timer2, timer3);
            console.log("点击事件");
        }

        btn2.onclick = function() {
            clearTimeout(timer1);
            clearTimeout(timer2);
            clearTimeout(timer3);
        }
    </script>
</body>

</html>